-
Notifications
You must be signed in to change notification settings - Fork 29
Adding Controller Framework that is used by Controller and Provisione… #5
Adding Controller Framework that is used by Controller and Provisione… #5
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brahmaroutu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5b56be6
to
0193bb9
Compare
The post build step for the previous commit failed: https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/post-container-object-storage-interface-api-push-images/1330951515501760512
Could you look into it please |
controller/controller.go
Outdated
c.locker = map[string]*sync.Mutex{} | ||
} | ||
if _, ok := c.locker[lockKey]; !ok { | ||
c.lockerLock.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to acquire this lock outside the if-condition. When there are multiple requests for the same key (that does not exist yet), they could race and lead to concurrent map access panic.
This should be outside the if-block
c.lockerLock.Lock()
defer c.lockerLock.Unlock()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
0193bb9
to
090afb0
Compare
@wlan the post trigger logic will be only for builds that need to push built images, this repo does not need one. |
/lgtm |
…se_tools We maintain release tools only under Spec repo
…se_tools We maintain release tools only under Spec repo
…tools Adding release tools for CI
…r as common code
Adding controller basic code that is used by other packages/repos.
assign @wlan0